<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input
        {
            width: 200px;
            height: 40px;
            font-size: 20px;
            line-height: 40px;
            text-align: center;
        }
    </style>
</head>
<body>
    <input id="first" type="text">
    <input id="second" type="text">
    <input id="btn" type="button" value="结果是">
    <br>
    <br>
    <input id="sum" type="text">
    <input id="times" type="text">
    
</body>
<script>
    var first = document.getElementById("first")
    var second = document.getElementById("second")
    var btn = document.getElementById("btn")
    var sum = document.getElementById("sum")
    var times = document.getElementById("times")

    var sum1 = 0;
    var times1 = 0;
    
    btn.onclick = function()
    {
        var fir = first.value - 0;
        var sec = second.value - 0;
        console.log(fir)
        sum1 = fir + sec ;
        console.log(sum1)
        
        times1 = fir * sec;
       
        sum.value = sum1;
        console.log(sum.innerHTML)
        times.value = times1;
        return;
    }
   

</script>
</html>